package com.itheima.controller;

import com.itheima.dto.EmpLoginDto;
import com.itheima.pojo.MyResponseResult;
import com.itheima.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class EmpLoginControtller {
    @Autowired
    private EmpService empService;

    @PostMapping("/login")
    public MyResponseResult<String> login(@RequestBody EmpLoginDto dto){
        //成功就返回 令牌 ，不成功就返回null，给前端返回，NOT_LOGIN
        return empService.login(dto);
    }

}
